/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Charles Gesser
 */
@Entity
@Table(name = "VENDAS_ITEM")
@NamedQueries({
    @NamedQuery(name = "VendasItem.findAll", query = "SELECT v FROM VendasItem v")})
public class VendasItem implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected VendasItemPK vendasItemPK;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "COM_QTD")
    private BigDecimal comQtd;
    @Column(name = "COM_VLR")
    private BigDecimal comVlr;

    public VendasItem() {
    }

    public VendasItem(VendasItemPK vendasItemPK) {
        this.vendasItemPK = vendasItemPK;
    }

    public VendasItem(int comCod, int comPro) {
        this.vendasItemPK = new VendasItemPK(comCod, comPro);
    }

    public VendasItemPK getVendasItemPK() {
        return vendasItemPK;
    }

    public void setVendasItemPK(VendasItemPK vendasItemPK) {
        this.vendasItemPK = vendasItemPK;
    }

    public BigDecimal getComQtd() {
        return comQtd;
    }

    public void setComQtd(BigDecimal comQtd) {
        this.comQtd = comQtd;
    }

    public BigDecimal getComVlr() {
        return comVlr;
    }

    public void setComVlr(BigDecimal comVlr) {
        this.comVlr = comVlr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (vendasItemPK != null ? vendasItemPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VendasItem)) {
            return false;
        }
        VendasItem other = (VendasItem) object;
        if ((this.vendasItemPK == null && other.vendasItemPK != null) || (this.vendasItemPK != null && !this.vendasItemPK.equals(other.vendasItemPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.VendasItem[ vendasItemPK=" + vendasItemPK + " ]";
    }
    
}
